<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 200px;
      height: 400px;
      background: red;
      position: relative;
    }

    span {
      position: absolute;
      /* left: 0; */
      /* right: 0; */
      top: 0;
      bottom: 0;
      margin: auto;
      width: 100px;
      height: 100px;
      background: green;
    }
  </style>
</head>

<body>
  <div>
    <span></span>
  </div>
</body>

</html>